extends ../common/layout
block content
  section#content
    section.vbox
      section.scrollable.wrapper
        .row
          .col-sm-9
            h5.font-bold #{blog.title}
            .blog-post
              .post-item
                //-.post-media
                  img.img-full(src='/images/man.jpgg')
                .caption.wrapper-lg
                  h2.post-title
                    a(href='/single/#{blog.id}') #{blog.title}
                  .post-sum
                    p !{blog.content}
                  .line.line-lg
                  .text-muted.
                    <i class="fa fa-user icon-muted"></i> by <a href="#" class="m-r-sm">#{blog.author.nickName}</a>
                    <i class="fa fa-clock-o icon-muted"></i> #{moment(blog.meta.updataAt).format('LLLL')}
              h4.m-t-lg.m-b  评论区
              section.comment-list.block
                 if comments
                  each comment in comments
                    article#comment-id-1.comment-item
                      a.pull-left.thumb-sm
                        img.img-circle(src='/#{comment.from.face}')
                      section.comment-body.m-b
                        header
                          a.comment(href='#comment',data-cid='#{comment._id}',data-tid='#{comment.from._id}')
                            strong  #{comment.from.nickName}
                          //-label.label.bg-info.m-l-xs Editor
                          span.text-muted.text-xs.block.m-t-xs
                            | #{moment(comment.meta.createAt).format('LLLL')}
                        .m-t-sm
                          | #{comment.content}
                    // .comment-reply
                    if comment.reply && comment.reply.length > 0
                      each reply in comment.reply
                        article#comment-id-2.comment-item.comment-reply
                          a.pull-left.thumb-sm
                            img.img-circle(src='/#{reply.from.face}')
                          section.comment-body.m-b
                            header
                              a(href='#')
                                strong  #{reply.from.nickName}
                              label.label.bg-dark.m-l-xs  #{reply.from.nickName}
                              span.text-muted.text-xs.block.m-t-xs #{moment(reply.meta.createAt).format('LLLL')}
                            .m-t-sm #{reply.content}
              .comments-area
                #respond.comment-respond
                  h4.m-t-lg.m-b 留下您的评论
                  form#commentform.comment-form(action='/comment', method='post', novalidate='')
                    input(type="hidden",name='comment[blog]',value='#{blog._id}')
                    if user
                      input(type="hidden",name='comment[from]',value='#{user._id}')
                      p.logged-in-as
                        | 以
                        a(href='#') #{user.nickName}
                        | 的身份登录。
                        a(href='/logout', title='登出此帐户') 登出？
                    else
                      p.comment-notes
                        span#email-notes 电子邮件地址不会被公开。
                        |  必填项已用
                        span.required *
                        | 标注
                      .form-group.row
                        .col-sm-6
                          label(for='author') Your Name:
                          span.required *
                          input#author.form-control(name='author', type='text', value='', size='30')
                        .col-sm-6
                          label(for='email') Your Email:
                          span.required *
                          input#email.form-control(name='email', type='text', value='', size='30')
                    .form-group
                      label(for='comment') 评论:
                      textarea#comment.form-control(name='comment[content]', cols='45', rows='8', aria-required='true')
                    button.btn.btn-success(type='submit') 提交 评论
          //-引用blog 侧边栏
          include ../common/blog-sidebar
